<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
//定义函数
function check(){
	//获取两个文本框的值
	var pwd1 = document.regForm.c_pass.value;
	var pwd2 = document.regForm.c_pass1.value;
	if(pwd1 === pwd2){ //两次密码一致;
		return true;
	}else{
		alert("两次密码不一致");//弹出提示框
		return false;
	}
	}

</script>
</head>
<body>
<form name="regForm" action="<%=request.getContextPath() %>/CustomerServlet" method="post" onSubmit="return check();">
<input type="hidden" name="method" value="reg">
用户名:<input type="text" name="c_name"><br>
密码:<input type="password" name="c_pass"><br>
确认密码：<input type="password" name="c_pass1"><br>
验证&nbsp;码:<input type="text" name="c_name" placeholder="验证码"/><img src="../CodeServlet"><a href="reg.jsp">看不清？</a><br>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>